<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>&lt;GMainLoop&gt;: </title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.2">
<link rel="home" href="index.html" title="">
<link rel="up" href="ch01.html" title="GLib">
<link rel="prev" href="re33.html" title="&lt;GMainContext&gt;">
<link rel="next" href="re35.html" title="&lt;GMappedFile&gt;">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="re33.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="re35.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="id-1.1.35"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>&lt;GMainLoop&gt;</h2>
<p>&lt;GMainLoop&gt;</p>
</div>
<div class="refsect1">
<a name="id-1.1.35.2"></a><h2>Description</h2>
<p>The <code class="code">GMainLoop</code> struct is an opaque data type
representing the main event loop of a GLib or GTK+ application.</p>
</div>
<div class="refsect1">
<a name="id-1.1.35.3"></a><h2>Functions</h2>
<div class="refsect2">
<a name="id-1.1.35.3.2"></a><h3>get-context</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (main-loop:get-context self))
</pre></div>
<p>Returns the <span class="type">GMainContext</span> of <em class="parameter"><code>loop</code></em>.</p>
<div class="refsect3">
<a name="id-1.1.35.3.2.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>loop</p></td>
<td class="parameter_description">
<p>a <span class="type">GMainLoop</span>.</p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.35.3.3"></a><h3>is-running?</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (main-loop:is-running? self))
</pre></div>
<p>Checks to see if the main loop is currently being run via <code class="function">g_main_loop_run()</code>.</p>
<div class="refsect3">
<a name="id-1.1.35.3.3.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>loop</p></td>
<td class="parameter_description">
<p>a <span class="type">GMainLoop</span>.</p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.35.3.4"></a><h3>quit</h3>
<div class="informalexample"><pre class="programlisting">(define-values () (main-loop:quit self))
</pre></div>
<p>Stops a <span class="type">GMainLoop</span> from running. Any calls to <code class="function">g_main_loop_run()</code>
for the loop will return.
</p>
<p>Note that sources that have already been dispatched when
<code class="function">g_main_loop_quit()</code> is called will still be executed.</p>
<div class="refsect3">
<a name="id-1.1.35.3.4.5"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>loop</p></td>
<td class="parameter_description">
<p>a <span class="type">GMainLoop</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.35.3.5"></a><h3>ref</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (main-loop:ref self))
</pre></div>
<p>Increases the reference count on a <span class="type">GMainLoop</span> object by one.</p>
<div class="refsect3">
<a name="id-1.1.35.3.5.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>loop</p></td>
<td class="parameter_description">
<p>a <span class="type">GMainLoop</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.35.3.6"></a><h3>run</h3>
<div class="informalexample"><pre class="programlisting">(define-values () (main-loop:run self))
</pre></div>
<p>Runs a main loop until <code class="function">g_main_loop_quit()</code> is called on the loop.
If this is called for the thread of the loop's <span class="type">GMainContext</span>,
it will process events from the loop, otherwise it will
simply wait.</p>
<div class="refsect3">
<a name="id-1.1.35.3.6.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>loop</p></td>
<td class="parameter_description">
<p>a <span class="type">GMainLoop</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.35.3.7"></a><h3>unref</h3>
<div class="informalexample"><pre class="programlisting">(define-values () (main-loop:unref self))
</pre></div>
<p>Decreases the reference count on a <span class="type">GMainLoop</span> object by one. If
the result is zero, free the loop and free all associated memory.</p>
<div class="refsect3">
<a name="id-1.1.35.3.7.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>loop</p></td>
<td class="parameter_description">
<p>a <span class="type">GMainLoop</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.35.3.8"></a><h3>main-loop:new</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (main-loop:new context is-running))
</pre></div>
<p>Undocumented</p>
<div class="refsect3">
<a name="id-1.1.35.3.8.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">context</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>is_running</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">is-running</code></p>
</td>
</tr>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>
